{extend name="layout" /}
{block name="style"}
<link rel="stylesheet" href="__STATIC__/editor.md/css/editormd.css" />
<style>
    .layui-layer{
        top:200px !important;
    }
</style>
{/block}
{block name="title"}添加文章{/block}
{block name="body"}
<blockquote class="layui-elem-quote layui-text">
    发表文章
</blockquote>
<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">简介</label>
        <div class="layui-input-block">
            <input type="text" name="desc" lay-verify="desc" autocomplete="off" placeholder="请输入简介" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">分类</label>
        <div class="layui-input-block">
            <input type="radio" name="type_id" value="1" title="技术博客" checked="" lay-filter="typeRadio">
            <input type="radio" name="type_id" value="2" title="生活日常" lay-filter="typeRadio">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">标签</label>
        <div class="layui-input-block">
            <select name="label_id" lay-filter="aihao" id="label">
                <option value=""></option>

            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">操作</label>
        <div class="layui-input-block">
            <input type="checkbox" name="options[show]" title="显示" checked="">
            <input type="checkbox" name="options[top]" title="置顶">
            <input type="checkbox" name="options[recommend]" title="推荐" >
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-upload">
            <label class="layui-form-label">上传封面</label>
            <div class="layui-input-block" style="position: relative;">
                <div style="position: absolute;top:45%;left:5%;"><input type="file" name="file" class="layui-upload-file" id="upload" ></div>

                <div class="layui-upload-list">
                    <img class="layui-upload-img" id="uploadImg" src="./public/uploads/default.jpg" style="width:250px;height:250px;border-radius: 50%;">
                    <input type="hidden" name="cover" id="cover">
                </div>
            </div>

        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-block">
            <div id="editormd" style="width:100%;float:left;">
                <textarea style="display:none;" name="content" lay-verify="content" id="remarkEditor">### Hello Editor.md !</textarea>
            </div>
            <!--<textarea name="content" lay-verify="content" id="remarkEditor" placeholder="请输入内容" class="layui-textarea layui-hide"></textarea>-->
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="add">提交</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script src="__STATIC__/editor.md/editormd.js"></script>
<script type="text/javascript">
    $(function() {


        /*
        // or
        var editor = editormd({
            id   : "editormd",
            path : "../lib/"
        });
        */
    });
</script>
<!-- layui规范化用法 -->
<script type="text/javascript">

    layui.config({
        base: '__JS__/'
    }).use('addArt');
</script>
{/block}